<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
	<title></title>
</head>
<body>
<?php 
  require_once('./system/dbConn.php');
    connect(); ?>
    <?php 
    $content=$_POST["content"];
    $cdate=date("YmdHis"); 
    session_start();
    $username=$_SESSION["username"];
    $sql0="select uid from users where uname='$username'";
    $result0=mysql_query($sql0);
    $row0=mysql_fetch_assoc($result0);
    $uid=$row0["uid"];
    $vid=$_POST["vid"];
    $sql="insert into comments values(null,'$content','$cdate',$uid,$vid)";
    $result=mysql_query($sql);
    if ($result==1) {
    	
    	echo "留言成功";
        header("refresh:3;url='show.php?vid=$vid'");
    }
    else{
    	echo "留言失败";
    }
    
    ?>
</body>
</html>

    

   


